import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';

// 导入History模式组件
import { BrowserRouter as Router } from 'react-router-dom'

// 导入antd组件库得css文件
import 'antd/dist/reset.css'

// 导入仓库
import { store, persistor } from '@/store'
import { Provider } from 'react-redux'

//如果使用React,则使用 PersistGate 包裹根组建
import { PersistGate } from 'redux-persist/lib/integration/react';

// 国际化
import zhCN from 'antd/locale/zh_CN';
// 配置中文国际化
import { ConfigProvider } from 'antd';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <Provider store={store}>
    <Router>
      <PersistGate loading={null} persistor={persistor}>
        <ConfigProvider locale={zhCN}>
          <App />
        </ConfigProvider>
      </PersistGate>
    </Router>
  </Provider>
);